<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <textarea  id="txt" cols="30" rows="10"></textarea>
    <button id="btn">过滤</button>
    <script>
        /*
        去除HTML 标签<>
        */
       var reg=/<[^<>]*>/g;
       var txt=document.getElementById("txt");
       var btn=document.getElementById("btn");
       btn.onclick=function(){
           var value=txt.value;
           var filter=value.replace(reg,"");
           txt.value=filter;
       }
    </script>
</body>
</html>